//
//  DTMultiLanguage.h
//
//
//  Created by JianWei Chen on 16/7/8.
//  Copyright © 2016年 JianWei Chen. All rights reserved.
//

/**
 *  1.如果是app内切换语言先
 *  [[TEALocalizableTool shareInstance] setCurrentLanguage:@""];
 *  再
 *  MyNSLocalizedString(key)
 *
 *  2.如果是根据系统语言来
 *  直接使用 MyNSLocalizedString(key);
 *
 *  @param key
 *
 *  @return
 */

#import <UIKit/UIKit.h>
//自定义字体

#define SanBox 1
#if SanBox

#define FontRegular(key) [UIFont systemFontOfSize:key]
#define FontBold(key) [UIFont boldSystemFontOfSize:key]
#define LabelFontBold(label) [label setFont:FontBold(label.font.pointSize)];
#define LabelFontRegular(label) [label setFont:FontRegular(label.font.pointSize)];

#else

#define FontRegular(key) [UIFont fontWithName:@"Play" size:key]
#define FontBold(key) [UIFont fontWithName:@"Play-Bold" size:key]
#define LabelFontBold(label) [label setFont:FontBold(label.font.pointSize)];
#define LabelFontRegular(label) [label setFont:FontRegular(label.font.pointSize)];

#endif



//语言
#define MyNSLocalizedString(key) ([[TEALocalizableTool shareInstance] localizedStringForKey: (key)])
#define TESetAppLanguage(lanString) [[TEALocalizableTool shareInstance] setCurrentLanguage: (lanString)]
#define UserLanguage @"UserLanguages"

@interface TEALocalizableTool : NSObject

@property (nonatomic, strong) NSString *currentLanguage;

+ (instancetype)shareInstance;

- (NSString *)localizedStringForKey:(NSString *)key;

@end

@interface UIView (FonSelf)

@property (nonatomic, copy) NSString *fontSelfKey;

@end

@interface UILabel (FontSelf)

@end


@interface UIButton (FontSelf)

@end


@interface UITextView (FontSelf)

@end


@interface UITextField (FontSelf)

@end